﻿using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Web;
using BUS;
using DTO;
using System.Web.UI.MobileControls;
using System.Collections.Generic;

namespace ASP.ADO
{
    [ServiceContract(Namespace = "")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class MangerAgency
    {
        [OperationContract]
        public void DoWork()
        {
            // Add your operation implementation here
            return;
        }
        [OperationContract]
        public DateTime GetDateTime()
        {
            //// Check the cache.
            //HttpContext context = HttpContext.Current;

            //if (context.Cache["CurrentDateTime"] != null)
            //{
            //    // Retrieve it from the cache
            //    return (DateTime)context.Cache["CurrentDateTime"];
            //}
            //else
            //{
            //    // Regenerate it.
            //    DateTime now = DateTime.Now;

            //    // Now store it in the cache for 5 seconds.
            //    context.Cache.Insert("CurrentDateTime", now, null,
            //     DateTime.Now.AddSeconds(5), TimeSpan.Zero);

            //    return now;
            //}
            return DateTime.Now;
        }

        [OperationContract]
        public List<HoSoDaiLyDTO> GetAllDaiLy()
        {
            return HoSoDaiLyBUS.SellectHoSoDaiLy_All();
        }

        // Add more operations here and mark them with [OperationContract]
    }
}
